<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">
	$(document).ready(function(){	
		$("#loginBtn").click(function(){
			var id=$("#id").val();
			var password=$("#password").val();			
			$.ajax({
				type:"POST",
				url:"${initParam.root}member/login.do",
				data:"id="+id+"&password="+password,
				success:function(data){	 				
					if(data==0){
						$("#idCheckView").html("아이디 비번 틀림요.").css("background","red");						
					}else{
						alert("접속합니당.");
						 url="${initParam.root}member/login_okView.do";							
						$(location).attr('href',url);
					}
				}//success		
			});//ajax 	
		});//submit		 	
	});//ready
</script>
아이디 : <input type="text" id="id" name="id"> <span id="idCheckView"></span><br> 
비밀번호 : <input type="password" id="password" name="password"><br> 
<input type="button" id="loginBtn" value="로그인">